package models

import (
	common "tuowei.com/common/models"
)

type SysClass struct {
	Id        int    `json:"id" gorm:"primaryKey;autoIncrement;comment:主键编码"` // 课程ID
	Name      string `json:"name" comment:"班级名称"`
	ClassType string `json:"class_type" comment:"班级类型"`
	Class     string `json:"class" comment:"班级分类"`
	//Province            int        `json:"province" comment:"省/市"`
	//City                int        `json:"city" comment:"区/县"`
	DeptId              int            `json:"dept_id" comment:"教学点"`
	Count               int            `json:"count" comment:"班级人数"`
	RealCount           int            `json:"real_count" gorm:"-" comment:"真实人数"`
	HeadMaster          int            `json:"head_master" comment:"班主任" vd:"$>0; msg:'请选择班主任'"`
	HeadMasterName      string         `json:"head_master_name" comment:"班主任名称"`
	RegionalManagerId   int            `json:"regional_manager_id" comment:"大区经理ID"`
	RegionalManager     string         `json:"regional_manager" comment:"大区经理"`
	CityLeaderId        int            `json:"city_leader_id" comment:"城市负责人ID"`
	CityLeader          string         `json:"city_leader" comment:"城市负责人"`
	AdmissionsOfficerId int            `json:"admissions_officer_id" comment:"招生负责人ID"`
	AdmissionsOfficer   string         `json:"admissions_officer" comment:"招生负责人"`
	Status              int            `json:"status" gorm:"type:tinyint(1);default:1;comment:班级状态，1-运行中，2-结业"`
	Dept                *TeachingPoint `json:"dept" gorm:"foreignKey:dept_id"`
	common.ControlBy
	common.ModelTime
}

func (SysClass) TableName() string {
	return "sys_class"
}

func (e *SysClass) Generate() common.ActiveRecord {
	o := *e
	return &o
}

func (e *SysClass) GetId() interface{} {
	return e.Id
}

type SysClassList struct {
	Id       int            `json:"id"`
	Name     string         `json:"name"`
	AreaName string         `json:"area_name"`
	DeptId   int            `json:"-"`
	Dept     *TeachingPoint `json:"-" gorm:"foreignKey:dept_id"`
	common.ModelTime
}

func (c SysClassList) TableName() string {
	return "sys_class"
}

type TeacherClassList struct {
	Id             int    `json:"id"`
	Name           string `json:"name"`
	DeptId         int    `json:"-"`
	HeadMasterName string `json:"head_master"`
}

func (c TeacherClassList) TableName() string {
	return "sys_class"
}
